{include file="./headStart.tpl"}
{literal}
<script type="text/javascript">
$(document).ready(function(){   
$("#categoryId").focus();
subCatFilterCombo();
});
function subCatFilterCombo()
{
  var dataString = "categoryId=" + $('#categoryId').val();
  $.ajax({
  	url: "./subCatFilterAj.php",
  	cache: false,
  	data: dataString,
  	success:function(data){
  		$('#subCatFiltComboBox').html(data);
  		$('#subCatFiltId').focus();
    }
  });
  itemFilterCombo();
}
function itemFilterCombo()
{
  var dataString = "subCategoryId=" + $('#subCatFiltId').val() + "&categoryId=" + $("#categoryId").val();
  $.ajax({
  	url: "./itemFilterAj.php",
  	cache: false,
  	data: dataString,
  	success:function(data){
  		$('#itemFiltId').html(data);
  		$('#itemFiltId').focus();
    }
  });
}
function getFilterData()
{
  var dataString = "itemId=" + $("#itemId").val() + "&subCategoryId=" + $("#subCatFiltId").val() + "&categoryId=" + $("#categoryId").val();
  $.ajax({
    type: "GET",
    url:  "productAj.php",
    data: dataString,
    success: function(data){ 
      $("#filteredData").html(data);
    }
  });
}
function getFilterTextData()
{
  var textString = "txtSearch=" + $("#searchTxt").val();
  $.ajax({
    type: "GET",
    url:  "productTxtFilterAj.php",
    data: textString,
    success: function(data){ 
      $("#filteredData").html(data);
    }
  });
}
</script>
{/literal}
{include file="./headEnd.tpl"}
<form action="{$smarty.server.PHP_SELF}" name='itemView' method='POST'>
<table border='0' cellpadding='1' cellspacing='2' align='center'>
<tr>
 <td class="table1" align="center" colspan="4"><font style="font-size: 16px"><b> Search :</b></font><input type="text" name="searchTxt" id="searchTxt">
    <input type="button" name="button" id="goButton" value=" G O... " class="button" onclick="getFilterTextData();" />
 </td>
</tr>
<tr>
  <td class="table1" align="center" colspan="4"><font style="font-size: 16px"><b> Product Filter </b></font></td>
</tr>
<tr>
  <td class="table1" align="center" colspan="4">From Date : 
    {html_select_date time=$fromDate prefix="fromDate" start_year="-2" end_year="+1" field_order="DMY" day_value_format="%02d"}
  </td>
</tr>
<tr>
  <td>Category :
    <select name="categoryId" id="categoryId" onchange="subCatFilterCombo();">
    	<option value="0">All</option>
      {html_options values=$categoryIdArr output=$categoryNameArr selected=$categorySelected}
    </select>
  </td>
   <td align='left'>
  	SubCategory :<span id="subCatFiltComboBox"></span><br/>
 	</td>
 	<td align='left'>
  	Product :<span id="itemFiltId"></span>
 	</td>
  <td valign="bottom" >
    <input type="button" name="button" id="goButton" value=" G O... " class="button" onclick="getFilterData();" />
  </td>
<tr>
</table>
<div id="filteredData">
</div>
</form>
{include file="footer.tpl"}